<?php
/* @var $view Model3_View */
//require_once 'dompdf/dompdf_config.inc.php';<link rel="stylesheet" href="'.$prueba.'" type="text/css" />
//ini_set("memory_limit", "32M");
//ob_start();
$content = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><head>
    <style> 
    body {
        margin: 0;
        font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 13px;
        line-height: 18px;
        color: #333333;
        background-color: #ffffff;
      }
    table {
        max-width: 100%;
        border-collapse: collapse;
        border-spacing: 0;
        }
     .table {
        width: 100%;
        margin-bottom: 18px;
      }
      .table th,.table td {
        padding: 4px;
        line-height: 18px;
        text-align: left;
        vertical-align: top;
        
      }   
        .table th {
          font-weight: bold;
          border-bottom: 1px solid #ddd;
        }
        .table thead th {
          vertical-align: bottom;
        }
        .table thead:first-child tr th, .table thead:first-child tr td {
          border-top: 0;
        }
        .table tbody + tbody {
          border-top: 2px solid #ddd;
        }
        .table-condensed th, .table-condensed td {
          padding: 4px 5px;
        }
        .span6 {
            width: 460px;
          }
          .span7 {
            width: 540px;
          }
        .span8 {
        width: 620px;
        }
        .span9 {
          width: 700px;
        }
        .span10 {
          width: 780px;
        }
        .barras
        {
            margin-top: 10px;
        }
        .verde{
            margin-top: -10px;
            margin-left: -99px;
        }
        .rojo{
            margin-top: 120px;
            margin-left: -130px
        }
        .azul{margin-top: -150px;}
    </style>
    </head><body>
<p>Fecha de Elaboracion:  <strong>'.$view->today.'</strong>  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    Fecha inicial del Reporte:<strong>'.$view->fechaIni.'</strong><br/>
    <strong>Reporte de turno con m&aacute;s demanda del sal&oacute;n</strong> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
    Fecha final del Reporte: <strong>'.$view->fechaFin.'</strong><br/>
    Cantidad de Eventos en el a&ntilde;o:'.$view->numEventos .'<br/>
</p>';
if ($view->numEventos > 0):   
    $content .= '<div id="reportes">
        <table class="table table-bordered table-striped">
            <tr>
                <th>Horario</th>
                <th>Cantidad de eventos </th>
            </tr>
            <tr>
                <td>Ma&ntilde;ana 07:00:00 a 12:50:00</td>
                <td>'. $view->eventosMañana.'</td>
            </tr>
            <tr>
                <td>Tarde 13:00:00 a 18:50:00</td>
                <td>'.$view->eventosTarde.'</td>
            </tr>
            <tr>
                <td>Noche 19:00:00 a 04:50:00</td>
                <td>'.$view->eventosNoche .'</td>
            </tr>
        </table>
        <img alt="*" src="./'.$view->urlGraphics.'"/>
        <br/><hr/>
        <img alt="*" src="./'.$view->noche.'"/>
        <img alt="*" src="./'.$view->tarde.'"/>
        <img alt="*" src="./'.$view->manana.'"/>
        <p style="margin-top: 70px;">'. $view->eventosNoche.'&nbsp; &nbsp; &nbsp; &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'. $view->eventosTarde. '
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; '. $view->eventosMañana. '</p>';
        else:
        $content .= '<div class="alert notice">Para este periodo de fechas no hay Reporte</div>';
    endif;
$content.= '</div>';
$content .= '</body></html>';
//echo $content;
$dompdf = new DOMPDF();
$dompdf->load_html($content);
$dompdf->render();
$dompdf->stream("Turnos de mayor demanda.pdf");

